<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArVersalogicIO Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArVersalogicIO.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="classArVersalogicIO-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArVersalogicIO Class Reference<div class="ingroups"><a class="el" href="group__OptionalClasses.html">Optional Classes</a> &#124; <a class="el" href="group__DeviceClasses.html">Device Interface Classes</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Interface to integrated digital and analog I/O interfaces on Versalogic VSBC8 and EBX-12 Cobra computers (digital IO on 2nd * gen.  
 <a href="classArVersalogicIO.html#details">More...</a></p>

<p><code>#include &lt;ArVersalogicIO.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a4c472f7ff0e386ab18f4093f32808c42"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c472f7ff0e386ab18f4093f32808c42"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Direction</b> { <b>DIGITAL_INPUT</b>, 
<b>DIGITAL_OUTPUT</b>
 }</td></tr>
<tr class="separator:a4c472f7ff0e386ab18f4093f32808c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aed8be986d9d901ce34e5aaae841b8e58"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#aed8be986d9d901ce34e5aaae841b8e58">ArVersalogicIO</a> (const char *dev=&quot;/dev/amrio&quot;)</td></tr>
<tr class="memdesc:aed8be986d9d901ce34e5aaae841b8e58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#aed8be986d9d901ce34e5aaae841b8e58">More...</a><br /></td></tr>
<tr class="separator:aed8be986d9d901ce34e5aaae841b8e58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af280c01496c4832e6e59cdaf7eeebd2d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#af280c01496c4832e6e59cdaf7eeebd2d">closeIO</a> (void)</td></tr>
<tr class="memdesc:af280c01496c4832e6e59cdaf7eeebd2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">tries to close the device. Returns false if operation failed  <a href="#af280c01496c4832e6e59cdaf7eeebd2d">More...</a><br /></td></tr>
<tr class="separator:af280c01496c4832e6e59cdaf7eeebd2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4c8f6195955d357db640158ff65b622"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#aa4c8f6195955d357db640158ff65b622">getAnalogValue</a> (int port, double *val)</td></tr>
<tr class="memdesc:aa4c8f6195955d357db640158ff65b622"><td class="mdescLeft">&#160;</td><td class="mdescRight">Take an analog reading from a port number from 0-7.  <a href="#aa4c8f6195955d357db640158ff65b622">More...</a><br /></td></tr>
<tr class="separator:aa4c8f6195955d357db640158ff65b622"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17b57a16013f990872540f4c06c2e924"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a17b57a16013f990872540f4c06c2e924">getAnalogValueRaw</a> (int port, int *val)</td></tr>
<tr class="memdesc:a17b57a16013f990872540f4c06c2e924"><td class="mdescLeft">&#160;</td><td class="mdescRight">Take an analog reading from a port number from 0-7.  <a href="#a17b57a16013f990872540f4c06c2e924">More...</a><br /></td></tr>
<tr class="separator:a17b57a16013f990872540f4c06c2e924"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17e24a978cfbc54feb0f58305cfdfaf4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17e24a978cfbc54feb0f58305cfdfaf4"></a>
Direction&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a17e24a978cfbc54feb0f58305cfdfaf4">getDigitalBankDirection</a> (int bank)</td></tr>
<tr class="memdesc:a17e24a978cfbc54feb0f58305cfdfaf4"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the direction (input or output) for the given bank <br /></td></tr>
<tr class="separator:a17e24a978cfbc54feb0f58305cfdfaf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabeaff29b3ef9f6c8a4c0f525c8ca06f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#aabeaff29b3ef9f6c8a4c0f525c8ca06f">getDigitalBankInputs</a> (int bank, unsigned char *val)</td></tr>
<tr class="memdesc:aabeaff29b3ef9f6c8a4c0f525c8ca06f"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the current value of the digital inputs on a certain bank  <a href="#aabeaff29b3ef9f6c8a4c0f525c8ca06f">More...</a><br /></td></tr>
<tr class="separator:aabeaff29b3ef9f6c8a4c0f525c8ca06f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ce5104770db19796d492f44961a7189"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a2ce5104770db19796d492f44961a7189">getDigitalBankOutputs</a> (int bank, unsigned char *val)</td></tr>
<tr class="memdesc:a2ce5104770db19796d492f44961a7189"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the current value of the digital outputs bits on a certain bank  <a href="#a2ce5104770db19796d492f44961a7189">More...</a><br /></td></tr>
<tr class="separator:a2ce5104770db19796d492f44961a7189"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9df4bd5e0b4a4b38d50d0086d904d49"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#aa9df4bd5e0b4a4b38d50d0086d904d49">getSpecialControlRegister</a> (unsigned char *val)</td></tr>
<tr class="memdesc:aa9df4bd5e0b4a4b38d50d0086d904d49"><td class="mdescLeft">&#160;</td><td class="mdescRight">gets the special register of the motherboard.  <a href="#aa9df4bd5e0b4a4b38d50d0086d904d49">More...</a><br /></td></tr>
<tr class="separator:aa9df4bd5e0b4a4b38d50d0086d904d49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53182991c21fd0f6dceed1decb4df200"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a53182991c21fd0f6dceed1decb4df200"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a53182991c21fd0f6dceed1decb4df200">isAnalogSupported</a> (void)</td></tr>
<tr class="memdesc:a53182991c21fd0f6dceed1decb4df200"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns true if analog values are supported <br /></td></tr>
<tr class="separator:a53182991c21fd0f6dceed1decb4df200"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0194347d04e6cec64c954e4ec2e51870"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0194347d04e6cec64c954e4ec2e51870"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a0194347d04e6cec64c954e4ec2e51870">isEnabled</a> (void)</td></tr>
<tr class="memdesc:a0194347d04e6cec64c954e4ec2e51870"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns true if the device is opened and operational <br /></td></tr>
<tr class="separator:a0194347d04e6cec64c954e4ec2e51870"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa823e82eb3a6eb8fbf08ea0a5b35b18"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa823e82eb3a6eb8fbf08ea0a5b35b18"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#aaa823e82eb3a6eb8fbf08ea0a5b35b18">lock</a> (void)</td></tr>
<tr class="memdesc:aaa823e82eb3a6eb8fbf08ea0a5b35b18"><td class="mdescLeft">&#160;</td><td class="mdescRight">lock the amrio device instance <br /></td></tr>
<tr class="separator:aaa823e82eb3a6eb8fbf08ea0a5b35b18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05c8da25c6eb898420556eb8ff29fa16"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05c8da25c6eb898420556eb8ff29fa16"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a05c8da25c6eb898420556eb8ff29fa16">setDigitalBankDirection</a> (int bank, Direction dir)</td></tr>
<tr class="memdesc:a05c8da25c6eb898420556eb8ff29fa16"><td class="mdescLeft">&#160;</td><td class="mdescRight">set direction for a particular digital I/O bank <br /></td></tr>
<tr class="separator:a05c8da25c6eb898420556eb8ff29fa16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47d3e871b3307049aee86044ead2f9fa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a47d3e871b3307049aee86044ead2f9fa">setDigitalBankOutputs</a> (int bank, unsigned char val)</td></tr>
<tr class="memdesc:a47d3e871b3307049aee86044ead2f9fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">set the value of the digital outputs bits  <a href="#a47d3e871b3307049aee86044ead2f9fa">More...</a><br /></td></tr>
<tr class="separator:a47d3e871b3307049aee86044ead2f9fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b28547dfbbec0b51b55304c63555f7b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8b28547dfbbec0b51b55304c63555f7b"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a8b28547dfbbec0b51b55304c63555f7b">tryLock</a> ()</td></tr>
<tr class="memdesc:a8b28547dfbbec0b51b55304c63555f7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to lock the device instance without blocking. <br /></td></tr>
<tr class="separator:a8b28547dfbbec0b51b55304c63555f7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a963c09b9a601bb7eaaf826a153c1263d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a963c09b9a601bb7eaaf826a153c1263d"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#a963c09b9a601bb7eaaf826a153c1263d">unlock</a> (void)</td></tr>
<tr class="memdesc:a963c09b9a601bb7eaaf826a153c1263d"><td class="mdescLeft">&#160;</td><td class="mdescRight">unlock the amrio device instance <br /></td></tr>
<tr class="separator:a963c09b9a601bb7eaaf826a153c1263d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af52e1f6603d5b5ec3e82e43ffaddb56f"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArVersalogicIO.html#af52e1f6603d5b5ec3e82e43ffaddb56f">~ArVersalogicIO</a> (void)</td></tr>
<tr class="memdesc:af52e1f6603d5b5ec3e82e43ffaddb56f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#af52e1f6603d5b5ec3e82e43ffaddb56f">More...</a><br /></td></tr>
<tr class="separator:af52e1f6603d5b5ec3e82e43ffaddb56f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:af815f601eba63044beda4326c11f36ab"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af815f601eba63044beda4326c11f36ab"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myAnalogEnabled</b></td></tr>
<tr class="separator:af815f601eba63044beda4326c11f36ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab552fbeb7c13f37e746e79a1b83a9cb2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab552fbeb7c13f37e746e79a1b83a9cb2"></a>
unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>myDigitalBank0</b></td></tr>
<tr class="separator:ab552fbeb7c13f37e746e79a1b83a9cb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae73f21d65d411191f76abc9e4e1f0a03"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae73f21d65d411191f76abc9e4e1f0a03"></a>
unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>myDigitalBank1</b></td></tr>
<tr class="separator:ae73f21d65d411191f76abc9e4e1f0a03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0921526737a68fa0675787d243ba02a7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0921526737a68fa0675787d243ba02a7"></a>
unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>myDigitalBank2</b></td></tr>
<tr class="separator:a0921526737a68fa0675787d243ba02a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1829a3b8e9c7f1302c224661bc40f195"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1829a3b8e9c7f1302c224661bc40f195"></a>
unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>myDigitalBank3</b></td></tr>
<tr class="separator:a1829a3b8e9c7f1302c224661bc40f195"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91df34557e98922711408d230c3b8614"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91df34557e98922711408d230c3b8614"></a>
<a class="el" href="classArRetFunctorC.html">ArRetFunctorC</a>&lt; bool, <a class="el" href="classArVersalogicIO.html">ArVersalogicIO</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myDisconnectCB</b></td></tr>
<tr class="separator:a91df34557e98922711408d230c3b8614"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab28eccbc8285f16bccb39147cfc9df7a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab28eccbc8285f16bccb39147cfc9df7a"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myEnabled</b></td></tr>
<tr class="separator:ab28eccbc8285f16bccb39147cfc9df7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef7f9eb40c9153a205f5b9f04a10f034"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef7f9eb40c9153a205f5b9f04a10f034"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>myFD</b></td></tr>
<tr class="separator:aef7f9eb40c9153a205f5b9f04a10f034"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9b19c0f208f1eb4c101a1beb8ba9c12"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac9b19c0f208f1eb4c101a1beb8ba9c12"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>myNumBanks</b></td></tr>
<tr class="separator:ac9b19c0f208f1eb4c101a1beb8ba9c12"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr class="memitem:a0fd2b54a2e46ed8bfc437d0eaa5a1293"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0fd2b54a2e46ed8bfc437d0eaa5a1293"></a>
static <a class="el" href="classArMutex.html">ArMutex</a>&#160;</td><td class="memItemRight" valign="bottom"><b>myMutex</b></td></tr>
<tr class="separator:a0fd2b54a2e46ed8bfc437d0eaa5a1293"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Interface to integrated digital and analog I/O interfaces on Versalogic VSBC8 and EBX-12 Cobra computers (digital IO on 2nd * gen. </p>
<p>PatrolBot)</p>
<p>This class is a basic set of calls to use the Linux device driver, <code>amrio</code>, which reads and writes data to VersaLogic's Opto22 and analog interfaces. The <code>amrio</code> driver must be built into the Linux kernel or its module loaded. Contact MobileRobots for information about obtaining this driver. It currently supports the Versalogic VSBC-8d, VSBC-8k, and EBX12 (Cobra) motherboards.</p>
<p>The digital portion of the Opto22 consists of two banks of 8 pins on the VSBC8 and four banks of 8 pins on the EBX12. Each bank can be set as either inputs or outputs. The banks are zero-indexed, so bank0 is the first one.</p>
<p>The analog inputs require a separate chip. There are 8 inputs, only one of which can be read at a time. It currently returns a value between 0 and 4096 or a decimal value in the range of 0-5V. The constructor will attempt an analog conversion, and if it fails will assume that the chip is not present and will disable the analog function.</p>
<p>See the motherboard manual for information about physical connections and specifications of the analog input and Opto22 digital IO. Computer motherboard manuals are available at <a href="http://robots.mobilerobots.com/docs">http://robots.mobilerobots.com/docs</a> .</p>
<p>The SPECIAL_CONTROL_REGISTER contains a few bits of information, the one of importance at the moment is the CPU_OVERTEMPERATURE bit, which will be set high if the CPU temp is over the warning temp as set in the BIOS. Bitwise AND the special_control_register output with 0x20 to find the temperature bit.</p>
<p>The destructor closes the device, so just delete the <a class="el" href="classArVersalogicIO.html" title="Interface to integrated digital and analog I/O interfaces on Versalogic VSBC8 and EBX-12 Cobra comput...">ArVersalogicIO</a> instance to close the device.</p>
<dl class="section note"><dt>Note</dt><dd>Not available on Windows </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aed8be986d9d901ce34e5aaae841b8e58"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ArVersalogicIO::ArVersalogicIO </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dev</em> = <code>&quot;/dev/amrio&quot;</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<p>Constructor for the <a class="el" href="classArVersalogicIO.html" title="Interface to integrated digital and analog I/O interfaces on Versalogic VSBC8 and EBX-12 Cobra comput...">ArVersalogicIO</a> class.</p>
<p>This will open the device named by <em>dev</em> (the default is "/dev/amrio" if the argument is omitted). It will find the number of digital banks and set the to inputs. It will also attempt to take an analog reading, which will fail if there is not analog chip present. If the conversion fails it will disable the analog portion of the code.</p>
<p>Check <a class="el" href="classArVersalogicIO.html#a0194347d04e6cec64c954e4ec2e51870" title="returns true if the device is opened and operational ">isEnabled()</a> to see if the device was properly opened during construction. </p>

</div>
</div>
<a class="anchor" id="af52e1f6603d5b5ec3e82e43ffaddb56f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ArVersalogicIO::~ArVersalogicIO </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor. </p>
<p>Attempt to close the device if it was opened </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af280c01496c4832e6e59cdaf7eeebd2d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::closeIO </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>tries to close the device. Returns false if operation failed </p>
<p>Close the device when <a class="el" href="classAria.html" title="Contains global initialization, deinitialization and other global functions. ">Aria</a> exits. </p>

</div>
</div>
<a class="anchor" id="aa4c8f6195955d357db640158ff65b622"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::getAnalogValue </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Take an analog reading from a port number from 0-7. </p>
<p>Returns an analog value converted from the raw reading to a scale if 0-5V.</p>
<p>This returns a conversion of the bits to a decimal value, currently assumed to be in the 0-5V range</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>the port number, between 0 and 7 </td></tr>
    <tr><td class="paramname">val</td><td>the address of the double to store the reading in </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if a reading was acquired. false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a17b57a16013f990872540f4c06c2e924"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::getAnalogValueRaw </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Take an analog reading from a port number from 0-7. </p>
<p>Returns the raw bit value as read by the chip.</p>
<p>This returns the actual reading from the chip, which is 12-bits</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>the port number, between 0 and 7 </td></tr>
    <tr><td class="paramname">val</td><td>the address of the integer to store the reading in </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if a reading was acquired. false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="aabeaff29b3ef9f6c8a4c0f525c8ca06f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::getDigitalBankInputs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the current value of the digital inputs on a certain bank </p>
<p>Returns the bits of the digital input bank.</p>
<p>A zero is 'on' for the hardware side of things, so this function negates it to make it more intuitive.</p>
<dl class="section return"><dt>Returns</dt><dd>true if the ioctl call was succcessfull, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a2ce5104770db19796d492f44961a7189"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::getDigitalBankOutputs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the current value of the digital outputs bits on a certain bank </p>
<p>Returns the state of the bits as they are currently set in the outputs.</p>
<p>It doesn't reconfirm with the hardware, but instead keeps track of how it last set them. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bank</td><td>which bank to check </td></tr>
    <tr><td class="paramname">val</td><td>the byte to write the values into </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the request was satisfied, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="aa9df4bd5e0b4a4b38d50d0086d904d49"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::getSpecialControlRegister </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>gets the special register of the motherboard. </p>
<p>The special_control_register contains various status bits, of which can be found in the manuals for the motherboards.</p>
<p>One interesting bit is the temperature bit, which gets set high if the CPU is over the specified threshold as set in the BIOS </p>

</div>
</div>
<a class="anchor" id="a47d3e871b3307049aee86044ead2f9fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArVersalogicIO::setDigitalBankOutputs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set the value of the digital outputs bits </p>
<p>The bits on the hardware side of the digital I/O ports are inverse-logic.</p>
<p>The bit must be set high in the register for the output to be off, and be set low to be turned on. This function negates that so that it is more intuitive.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bank</td><td>the bank number to use. 0 is the lowest bank </td></tr>
    <tr><td class="paramname">val</td><td>the status of the 8-bits in a single byte. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ArVersalogicIO.h</li>
<li>ArVersalogicIO.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArVersalogicIO.html">ArVersalogicIO</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
